package cn.jason.ymcc.feign;

import cn.jason.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseUserLearnFeignClientFallBackFactory implements FallbackFactory<cn.jason.ymcc.feign.CourseUserLearnFeignClient> {
    @Override
    public cn.jason.ymcc.feign.CourseUserLearnFeignClient create(Throwable throwable) {
        return new cn.jason.ymcc.feign.CourseUserLearnFeignClient() {
            @Override
            public JSONResult checkUrlPermission(Long courseId, Long loginId) {
                throwable.printStackTrace();
                return JSONResult.error("课程服务不可达！！");
            }

            @Override
            public JSONResult courseOrderInfo(String courseIds) {
                throwable.printStackTrace();
                return JSONResult.error("课程服务不可达！！");
            }
        };
    }
}
